import 'package:flutter/material.dart';
import 'package:flutter_application_cyber/pages/Mine/cn_blockList.dart';
import 'package:flutter_application_cyber/pages/Mine/cn_coinStore_Page.dart';
import '../pages/Mian/cn_login_page.dart';
import '../pages/Mian/cn_welcome_page.dart';
import '../pages/Mine/cn_editProfile.dart';
import '../pages/Mine/cn_country_Page.dart';
import '../pages/Mate/cn_mate_home_page.dart';
import '../pages/Mine/cn_setting_page.dart';
import '../pages/Mine/cn_about.dart';
import '../pages/Mate/cn_mateIng_page.dart';
import '../pages/Home/cn_call_wait_page.dart';
import '../pages/Message/cn_follow_list_page.dart';
import '../pages/Message/cn_message_list_page.dart';
import '../pages/Message/cn_message_chat_page.dart';
//配置路由,定义Map类型的routes,Key为String类型，Value为Function类型
final Map<String, Function> routes = {
  /*****************************************路由页面*******************************************************/
  '/CnWelcomePage':(context)=>  const CnWelcomePage(),
  '/CnLoginPage':(context)=>  const CnLoginPage(),
  '/editProfile':(context)=>  const CnEditProfile(),
  '/countryPage':(context)=>  const CnCountryPage(),
  '/settingPage':(context)=>  const CnSettingPage(),
  '/about':(context)=>  const CnAboutPage(),
  '/mate_home_page':(context)=>  const CnMateCnHomePage(),
  '/coinStorePage':(context,{arguments})=>   CnCoinStorePage(isPodPage: arguments,),
  '/bockList':(context)=>  const CnBlockList(),
  '/mateIng_page':(context)=>  const CnMateIngPage(),
  '/call_wait_page':(context,{arguments})=>   CnCallWaitPage(avatarUrl: arguments,nikeName: arguments,),
  '/message_list_page':(context)=>  const CnMessageListPage(),
  '/follow_list_page':(context)=>  const CnFollowListPage(),
 //会话页面
  '/conversation': (context, {arguments}) =>
      CnMessageChatPage(arguments: arguments),


};

var onGenerateRoute = (RouteSettings settings) {
  final String? name = settings.name;
  final Function? pageContentBuilder = routes[name];
  if (pageContentBuilder != null) {
    if (settings.arguments != null) {
      final Route route = MaterialPageRoute(
          builder: (context) =>
              pageContentBuilder(context, arguments: settings.arguments));
      return route;
    } else {
      final Route route =
      MaterialPageRoute(builder: (context) => pageContentBuilder(context));
      return route;
    }
  }
};
